home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10860 < prev    next >
Encoding:
Text File  |  1996-08-05  |  947 b   |  52 lines

  1. Path: newsfeeds.ans.net!interaccess!usenet
  2. From: brianmcg@interaccess.com (Brian V. McGroarty)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: QUESTION ABOUT FILES IN C
  5. Date: 20 Mar 1996 14:18:45 GMT
  6. Organization: Internet Squire
  7. Message-ID: <4ip445$g6h@nntp.interaccess.com>
  8. References: <4inhea$ap4@helios.canaldinamic.es>
  9. Reply-To: brianmcg@interaccess.com
  10. NNTP-Posting-Host: d41-isdn.nhe.interaccess.com
  11. X-Newsreader: Internet Squire 1.20
  12.  
  13. In C you would create a structure such as:
  14.  
  15. struct pau
  16. {
  17.     int uno;
  18.     char dos[ 256 ];
  19. }
  20.  
  21. The structure above would then be read and written with fread and fwrite,
  22. specifying "sizeof(struct pau)" as the item size.
  23.  
  24.  
  25.  
  26.  
  27. Pau Vallbona Rigo wrote:
  28. >I have a problem with files in c
  29. >In pascal i can make this:
  30. >example:
  31.  
  32. >pau=record
  33. >uno:integr;
  34. >dos:string[];
  35. >end;
  36. >var 
  37. >pero:file of pau;
  38. >....
  39.  
  40. >How can i define a file like this?
  41.  
  42.  
  43.  
  44. ---
  45. Brian Valters McGroarty -- brianmcg@bix.com
  46. phone/fax (847) 439-7714
  47.  
  48.  
  49.  
  50.  
  51.  
  52.